#define _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include<stdio.h>
int main()
{
    int n = 0;
    int a = 0;
    int b = 0;
    int c = 0;
    int count = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
        //getchar();
        scanf("%d%d%d", &a, &b, &c);
        double ave = (a + b + c) / 3;
        if (ave < 60)
        {
            count++;
        }
    }
    printf("%d\n", count);

    return 0;
}